import test03

dict1 = {'name': '两点水', 'age': '23', 'sex': '男'}

for key in dict1:  # 迭代 dict 中的 key
    print("key\t" + key, end=' ')
    print("\t", end=' ')
    print("value\t" + dict1.get(key), end=' ')
    print()
print('\n')

tuple1 = (1, 2, 3, 4)
iter3 = iter(tuple1)

for x in iter(tuple1):
    print(x, end=' ')

while iter3:
    try:
        print(next(iter3))
    except:
        break

# print('\n'.join([' '.join('%dx%d=%2d' % (x, y, x * y) for x in range(1, y + 1)) for y in range(1, 10)]))

list1 = [x+2 for x in range(1, 11) if x%2 == 0]
print(list1)

list1 = [1,2,3,4,5]
for num1 in reversed(list1) :
    print ( num1 , end = ' ' )


def test(name, sex='male', *nums):
    print(1212)
    print(f"Name: {name}, Sex: {sex}, Nums: {nums}")

# 不传递sex参数，传递nums参数
test("Alice", nums=(10, 20, 30))

